<?php defined('_JEXEC') or die('Restricted access');
$doc =& JFactory::getDocument();
$doc->setMetaData( 'generator', 'ODude.com Ecard System FREE 1.4' );
$doc->setTitle($this->title);
?>

<style type="text/css">
<!--
.bar {
	color: <?php echo $this->a4 ?>;
	background-color: <?php echo $this->a2 ?>;
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: <?php echo $this->a3 ?>;

}
.box {
	background-image: url(<?php echo JURI::root() ?>images/stories/ecard/<?php echo $this->cate_bg ?>);
	border: 1px solid <?php echo $this->a2 ?>;
}


.red {
	border: 1px solid red;
}


.errorMessage {
	color: red;
	margin-left: 10px;
	font-size: 0.8em;
}


#card {
	BORDER-RIGHT: #ccc 1px solid;
	PADDING-RIGHT: 3px;
	BORDER-TOP: #ccc 1px solid;
	DISPLAY: inline;
	PADDING-LEFT: 3px;
	BACKGROUND: <?php echo $this->a1 ?>;
	FLOAT: left;
	PADDING-BOTTOM: 3px;
	MARGIN: 1px 1px 1px 1px;
	BORDER-LEFT: #ccc 1px solid;
	PADDING-TOP: 3px;
	BORDER-BOTTOM: #ccc 1px solid;
	LIST-STYLE-TYPE: none;
	TEXT-ALIGN: center
}
#card2 {
	BORDER-RIGHT: #ccc 1px solid;
	BORDER-TOP: #ccc 1px solid;
	BACKGROUND: #f5f5f5;
	MARGIN: 1px;
	BORDER-LEFT: #ccc 1px solid;
	BORDER-BOTTOM: #ccc 1px solid;
	LIST-STYLE-TYPE: none;
	padding: 3px;
}
#card A {
	COLOR: #333;
	TEXT-DECORATION: none
}
#card A:hover {
	COLOR: #0000C0;
}
#tnt_pagination {
	display:block;
	text-align:left;
	height:22px;
	line-height:21px;
	clear:both;
	padding-top:3px;
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
	font-weight:normal;
}
#tnt_pagination a:link, #tnt_pagination a:visited {
	padding:7px;
	padding-top:2px;
	padding-bottom:2px;
	border:1px solid #EBEBEB;
	margin-left:3px;
	text-decoration:none;
	background-color:<?php echo $this->a1 ?>;
	color:<?php echo $this->a4 ?>;
	width:22px;
	font-weight:normal;
}
#tnt_pagination a:hover {
	background-color:<?php echo $this->a2 ?>;
	border:1px solid <?php echo $this->a3 ?>;
	color:#0072BC;
}
#tnt_pagination .active_tnt_link {
	padding:7px;
	padding-top:2px;
	padding-bottom:2px;
	border:1px solid <?php echo $this->a3 ?>;
	margin-left:10px;
	text-decoration:none;
	background-color:<?php echo $this->a2 ?>;
	color:<?php echo $this->a4 ?>;
	cursor:default;
}
#tnt_pagination .disabled_tnt_pagination {
	padding:7px;
	padding-top:2px;
	padding-bottom:2px;
	border:1px solid #EBEBEB;
	margin-left:10px;
	text-decoration:none;
	background-color:<?php echo $this->a1 ?>;
	color:#D7D7D7;
	cursor:default;
}

-->
</style>
<?php 

	if($this->cate_banner!="")
	echo "<center><img src=\"images/stories/ecard/".$this->cate_banner."\" alt=\"".$this->cate_name."\"  /></center>";


?>
<div class=box>
  <div class=bar align="center"><?php echo $this->cate_name ?></div>


<?php echo $this->id;  ?>
<?php
if($this->v=='o')
{
	?>
	<center>
<?php echo JText::_('ECARD_HELLO'); ?> <?php echo $this->RN;  ?>, <?php echo JText::_('ECARD_YOU'); ?><br />

<?php
 		if($this->type=='J')
		echo "<img src='".JURI::base()."images/stories/ecard/".$this->image."' alt='".$this->title."' border=1><br>".$this->title;
		
		if($this->type=='F')
		echo "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"535\" height=\"278\" id=".$this->title." align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=".JURI::base()."images/stories/ecard/".$this->image." /><param name=\"quality\" value=\"high\" /><embed src=".JURI::base()."images/stories/ecard/".$this->image." quality=\"high\"  width=\"535\" height=\"278\" name=".$this->title." align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object><br>".$this->title;

?>
</center>
<br />
<br />
<div class=bar align="center"><?php echo JText::_('ECARD_SENDER'); ?></div>
<?php
  $dispatcher =& JDispatcher::getInstance();
  $dispatcher->trigger('getProfilePic', array('email',$this->SE,'icon' ));
?>  <BR>
<?php echo JText::_('ECARD_SENDER_NAME'); ?>: <?php echo $this->SN;  ?><br />
<?php echo JText::_('ECARD_SENDER_EMAIL'); ?>: <?php echo $this->SE;  ?><br />
<?php echo JText::_('ECARD_DATE'); ?>: <?php echo $this->clock;  ?><br />
<div class=bar align="center"><strong><?php echo $this->sub; ?></strong></div>
<pre><?php echo wordwrap($this->body);  ?></pre>
<?php //echo nl2br(htmlspecialchars($this->body)) ?>


<?php


		if($this->notify=="Y")
		{
		
		$from = $this->from_email;
		$fromname = $this->from_name;
		$recipient = $this->SE;
		$subject = $this->msgsuffix.': '.JText::_('ECARD_PICKEDUP'). ' '.$this->RN;
		
			$u =& JURI::getInstance();	
			
		$db =& JFactory::getDBO();
		$qr="update #__ecard_view set notify='N' where id='".$this->xid."'";
		$db->setQuery($qr);
		$result = $db->query();
		
	$linc=$u->getScheme()."://".$u->getHost().JRoute::_("index.php?option=com_odudecard&amp;xid=".$this->xid."&amp;notify=N&amp;controller=odudecardpick&amp;cate=".$this->cat);

		
		$mode = 1;
$body = JText::_('ECARD_HELLO').",<br><br>".JText::_('ECARD_PICKEDUP')." ".$this->RN.".<br><br>".JText::_('ECARD_CLICK_LINK')."<br><br><a href=".$linc.">".$linc."</a><br><br>".JText::_('ECARD_THANK')."<br>$fromname";

		JUtility::sendMail($from, $fromname, $recipient, $subject, $body, $mode,'','','','', '');
		echo "<br>".JText::_('ECARD_NOTIFIED');

		}


}
echo "<br><a href=".JRoute::_("index.php?option=com_odudecard")."><strong>".JText::_('ECARD_NEW')."</strong></a>";
?>
</div>

<BR><a href=http://www.odude.com target=_blank ><img src="components/com_odudecard/images/dot.gif" border=0 align=right></a>
